//2009/08/09 15:57:12
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class EyeDrops
{
public:
    double closest(int sleepTime, int k)
    {
		if(k == 1) return 24 * 60.0 / k;
		double d1 = (24 - sleepTime) * 60.0 / (k - 1);
		double d2 = 24 * 60.0 / k;
		return min(d1, d2);
    }
};
